home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: watt.seas.Virginia.EDU!tdm6d
- From: tdm6d@watt.seas.Virginia.EDU (Thomas David Mcgarry)
- Subject: Pascal/C/C++ routine interfacing
- X-Nntp-Posting-Host: watt.seas.virginia.edu
- Message-ID: <DnyE5s.MJJ@murdoch.acc.Virginia.EDU>
- Sender: usenet@murdoch.acc.Virginia.EDU
- Organization: uva
- Date: Fri, 8 Mar 1996 14:41:51 GMT
-
- I am trying to either 1. Call a C/C++ routine/function using
- pascal or vice versa. Preferably the former. The documentation
- on these things is either horrendous or unavailable. Borland
- threw in a couple of demo programs in older versions of pascal
- and C++. But in the comments, it says you can't use any of the
- runtime library routines from C in Pascal wihout declaring them
- explicitly in the C routine code and recompiling. The problem
- is that most (if not all) the versions of C/C++ do not come
- with the library routine source codes.
- So I try to link the .OBJ files created by C into
- pascal and calll the external functions that I created. But
- when pascal encounters something like a "printf" or "scanf" it
- has no idea what these things are. Do I really have to
- recompile even simple functions so pascal can understand? Is
- there an easier way to do this. I do not want to go through
- windows and create DLL's. I need to pass data between the two
- languages. If this is not possible, can anyone tell me how to
- call pascal functions and procedures from inside C code? I
- know a little about the "extern" and "pascal" keywords" but I
- have had little luck in doing this. Help! I am greatly
- indebtted.
- --
- -------------------------------------------------------------------------
- Thomas David McGarry
- University of Virginia
- Materials Science Department
-